
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
     <include file="Index/head" />
    <link href="__PUBLIC__/css/dashboard.css" rel="stylesheet">

  </head>

  <body>

    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
<!--           <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button> -->
          <a class="navbar-brand" href="#">数据字典</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
<!--             <li><a href="#">Dashboard</a></li>
            <li><a href="#">Settings</a></li>
            <li><a href="#">Profile</a></li>
            <li><a href="#">Help</a></li> -->
          </ul>
          <form class="navbar-form navbar-right">
            <input type="text" class="form-control" placeholder="Search...">
          </form>
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
          <include file="Index/menu" />
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <h2 class="sub-header">数据库表<span style="float:right;"><a href="{:U('Home/Database/add')}"><button type="button" class="btn btn-success">添加数据库</button></a></span></h2>
          <div class="table-responsive">
            <table class="table table-striped">
              <thead>
                <tr>
                  <th>数据库名(英文)</th>
                  <th>数据库名(中文)</th>
                  <th>编码方式</th>
                </tr>
              </thead>
              <tbody>
              <volist name="list" id="vo">
                <tr>
                  <td>{$vo.db_name}</td>
                  <td>{$vo.db_name_ch}</td>
                  <td>{$vo.db_encoding}</td>
                  <td style="width:54px;"><a href="{:U('Home/Database/tables',array('dbid' => $vo['dbid']))}"><button type="button" class="btn btn-success">查看</button></a></td>
                  <td style="width:54px;"><a href="{:U('Home/Database/modify',array('dbid' => $vo['dbid']))}"><button type="button" class="btn btn-info">修改</button></a></td>
                  <td style="width:54px;"><button type="button" class="btn btn-danger" onclick="javascript:del_database({$vo.dbid});">删除</button></td>
                </tr>
              </volist>
              </tbody>
            </table>
            {$show}
          </div>
        </div>
      </div>
    </div>
      <include file="Index/footer" />
<script type="text/javascript">
    function del_database(dbid){
        var r = confirm('确定删除该字段?');
        if(r){
            var url = "{:U('Home/Database/del_database')}";
            var now_url = window.location.href;
            $.ajax({
                type:'post',
                url:url,
                data:{dbid:dbid},
                dataType:'json',
                success:function(data){
                    if(data==1){
                        window.location.href = now_url;
                    }
                }
            });
        }else{
            return false;
        }
    }
</script>
  </body>
</html>
